<template>
  <div class="containers">
    <div class="container">
      <div class="form-box" style="width: 100%;max-width: 900px;">
        <el-tabs>
          <el-tab-pane label="商家提现" >
            <el-form ref="form" label-width="120px">
              <el-form-item label="是否开启提现">
                <el-switch v-model="form.is_open" active-color="#13ce66" inactive-color="red">
                </el-switch>
              </el-form-item>
              <el-form-item label="手续费比例">
                <el-input v-model="form.proportion"></el-input>
              </el-form-item>
              <el-form-item label="最高手续费">
                <el-input v-model="form.max_proportion"></el-input>
              </el-form-item>
              <el-form-item label="最低手续费">
                <el-input v-model="form.min_proportion"></el-input>
              </el-form-item>
              <el-form-item label="最小提现金额">
                <el-input v-model="form.min_money"></el-input>
              </el-form-item>
              <el-form-item label="最大提现金额">
                <el-input v-model="form.max_money"></el-input>
              </el-form-item>
              <el-form-item label="是否提现整数倍">
                <el-switch v-model="form.is_multiple" active-color="#13ce66" inactive-color="red">
                </el-switch>
              </el-form-item>
              <el-form-item label="是否初审">
                <el-switch v-model="form.is_preliminary" active-color="#13ce66" inactive-color="red">
                </el-switch>
              </el-form-item>
              <span class="dialog-footer">
                <el-button type="primary" @click="setlv()">确 定</el-button>
              </span>
            </el-form>
          </el-tab-pane>
        </el-tabs>
       
      </div>
    </div>
  </div>
</template>

<script>

export default {


  data() {
    return {
      code:1,
      form: {
        proportion: '',
        max_proportion: '',
        min_proportion: '',
        min_money: "",
        max_money: '',
        is_multiple: false,
        is_open: false,
        is_preliminary:false,
        code: 1
      }


    };
  },
  created() {
    this.load()//获取
  },
  methods: {
    load() {
      this.request('admin/set_cash/', 'get', {code:1}).then(
        res => {
          if (res.errno == 0) {
            this.form = res.data
          }
        },
        function () {
          console.log('请求失败处理');
        }
      );
    },
    setlv() {
      this.form.proportion = Number(this.form.proportion)
      this.form.max_proportion = Number(this.form.max_proportion)
      this.form.min_proportion = Number(this.form.min_proportion)
      this.form.min_money = Number(this.form.min_money)
      this.form.max_money = Number(this.form.max_money)
      this.form.code = Number(this.code)
      this.request('admin/set_cash/', 'post', this.form).then(
        res => {
          this.$message.success(res.errmsg)
        },
        function () {
          console.log('请求失败处理');
        }
      );
    }




  }
};
</script>
<style scoped="scoped">
.container {
  padding: 20px;
}

.activeattr {
  border: 1px solid rgb(64, 158, 255);
  color: rgb(64, 158, 255);
}

.el-upload {
  width: 100px !important;
  height: 100px !important;
}
</style>